home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 12 / 012.d81 / comal #5 < prev    next >
Text File  |  2022-08-26  |  4KB  |  265 lines

  1.  
  2. COMAL corner-Part 5    by Jimmy Weiler
  3.  
  4.    THE COMAL 0.14 OPERATING SYSTEM
  5.  
  6.  - - - - - - - - - - - - - - - - - -
  7. PART THE THIRD: GETTING SOPHISTICATED
  8.  WITH PROGRAM ENTRY AND DEVELOPMENT
  9.  - - - - - - - - - - - - - - - - - -
  10.  
  11. Command: 'SIZE'
  12.  
  13.   As you write a COMAL program, part
  14.  
  15. of memory will be filled with the
  16.  
  17. program lines you type in.  When you
  18.  
  19. RUN the program, more of memory fills
  20.  
  21. up with the variables it uses.
  22.  
  23.   When you type SIZE the computer will
  24.  
  25. tell you how many bytes of memory are
  26.  
  27. still available for program lines or
  28.  
  29. variable storage.  Free space can be
  30.  
  31. a vital consideration when you are
  32.  
  33. writing large programs.
  34.  
  35.  - - - - - - - - - - - - - - - - - -
  36.  
  37. Command: 'AUTO'
  38.  
  39.   When you enter AUTO, you tell COMAL
  40.  
  41. to automatically supply you with line
  42.  
  43. numbers as you enter program code.
  44.  
  45. You can select the starting line
  46.  
  47. number and the increment.
  48.  
  49.   AUTO by itself supplies you with
  50.  
  51. lines starting at 0010 and increasing
  52.  
  53. by 10.
  54.  
  55. AUTO
  56. 0010 first'line
  57. 0020 second'line
  58. 0030 etcetera
  59.  
  60.   AUTO followed by a single number
  61.  
  62. will supply lines starting at that
  63.  
  64. number and incrementing by 10.
  65.  
  66. AUTO 400
  67. 0400 first'line
  68. 0410 next'line
  69. 0420 etcetera
  70.  
  71.   AUTO followed by two numbers will
  72.  
  73. supply lines starting at the first
  74.  
  75. number and incrementing by the second.
  76.  
  77. AUTO 1000,100
  78. 1000 first'line
  79. 1100 second'line
  80. 1200 and'so'on
  81.  
  82.   You can stop automatic line
  83.  
  84. numbering by moving off the line with
  85.  
  86. the cursor keys.
  87.  
  88.   Line numbers are needed to keep your
  89.  
  90. program lines in order.  COMAL,
  91.  
  92. unlike BASIC, does NOT use line
  93.  
  94. numbers as references for branching.
  95.  
  96.   Because you don't need to pay much
  97.  
  98. attention to line numbers, AUTO allows
  99.  
  100. the programmer to ignore that bit of
  101.  
  102. overhead and concentrate on the REAL
  103.  
  104. work of writing code.
  105.  
  106.  - - - - - - - - - - - - - - - - - -
  107.  
  108. Command: 'RENUM'
  109.  
  110.   This is, of course, the COMAL
  111.  
  112. "renumber" command.  It changes the
  113.  
  114. line numbers in your entire COMAL
  115.  
  116. program.
  117.  
  118.   RENUM by itself will renumber your
  119.  
  120. program starting with 0010 and
  121.  
  122. incrementing by 10.
  123.  
  124.   RENUM followed by a number will
  125.  
  126. renumber your program so that the
  127.  
  128. first line has that number and the
  129.  
  130. other lines increment by 10.
  131.  
  132. Example:
  133. RENUM 100
  134.  
  135. RENUM followed by two numbers will
  136.  
  137. make your program lines start with
  138.  
  139. the first number and increment by the
  140.  
  141. second.
  142.  
  143. Example:
  144.  
  145. LIST
  146. 0010 PRINT "HOME";
  147. 0020 PRINT "ON THE RANGE."
  148. RENUM 100,50
  149. LIST
  150. 0100 PRINT "HOME";
  151. 0150 PRINT "ON THE RANGE."
  152.  
  153.   In general, there is no reason to
  154.  
  155. renumber a COMAL program unless you
  156.  
  157. need to insert an instruction between
  158.  
  159. two lines whose line numbers differ by
  160.  
  161. one.
  162.  
  163.  - - - - - - - - - - - - - - - - - -
  164.  
  165. Command: 'DEL'
  166.  
  167.   You remove a line or a range of
  168.  
  169. lines from a COMAL program with the
  170.  
  171. DEL command.  In BASIC you can
  172.  
  173. delete a line by merely typing its
  174.  
  175. number.  In COMAL, that line would
  176.  
  177. still exist in the program, although
  178.  
  179. its contents may be changed.
  180.  
  181. Example:
  182.  
  183. Before:
  184. LIST
  185. 100 //
  186. 105 PRINT "THERE IS NOTHING"
  187. 110 PRINT "YOU CAN'T DO WITH"
  188. 300 PRINT "COMAL, FOR ITS"
  189. 400 PRINT "STRUCTURE IS"
  190. 500 PRINT "GOOD."
  191.  
  192. DEL 100     -- deletes line 100
  193. DEL 110,400 -- deletes all lines from
  194.                110 through 400
  195. After:
  196. LIST
  197. 105 PRINT "THERE IS NOTHING"
  198. 500 PRINT "GOOD."
  199.  
  200.  - - - - - - - - - - - - - - - - - -
  201.  
  202. Command: 'EDIT'
  203.  
  204.   When you LIST a COMAL program, the
  205.  
  206. line numbers are set off to the side
  207.  
  208. to make it more readable.  However,
  209.  
  210. when you want to change a program
  211.  
  212. line, you want it to look all crunched
  213.  
  214. up, like BASIC.
  215.  
  216.   The EDIT command is an alternate
  217.  
  218. way to list so that lines are easier
  219.  
  220. to modifiy.  You can EDIT lines one at
  221.  
  222. a time or specify a range of lines to
  223.  
  224. EDIT.
  225.  
  226. Example:
  227.  
  228. LIST 100
  229. 0100 PRINT 'WHEN I EDIT THIS, IT WILL
  230.      LOOK A LOT  BETTER.'
  231.  
  232. EDIT 100
  233. 0100 PRINT 'WHEN I EDIT THIS, IT WILL
  234. LOOK A LOT  BETTER.'
  235.  
  236.   If you were to edit the first
  237.  
  238. example, the resulting code might
  239.  
  240. print something like this:
  241.  
  242. WHEN I EDIT THIS, IT WILL       LOOK A
  243.  LOT  BETTER.
  244.  
  245.   If you edit the second example, you
  246.  
  247. can be sure that the content would
  248.  
  249. not change.
  250.  
  251. WHEN I EDIT THIS, IT WILL LOOK A LOT
  252. BETTER.
  253.  
  254.  - - - - - - - - - - - - - - - - - -
  255.  
  256.   This concludes our introduction to
  257.  
  258. the COMAL operating system.  Now you
  259.  
  260. are ready to start learning the COMAL
  261.  
  262. language.
  263.  
  264. --------------------------------------
  265.